import "reflect-metadata";
import { Entity, Column } from "typeorm";

@Entity("wx_setting")
export class WeiXinSetting {

    @Column({ primary: true, name: "id", type: "char", length: 36 })
    id: string;

    @Column({ name: "app_id", type: "varchar", length: 50, nullable: true })
    AppId?: string;

    @Column({ name: "app_secret", type: "varchar", length: 50, nullable: true })
    AppSecret?: string;

    /** 商户 ID */
    @Column({ name: "partner_id", type: "varchar", length: 50, nullable: true })
    PartnerId?: string;

    /** 商户 KEY */
    @Column({ name: "partner_key", type: "varchar", length: 50, nullable: true })
    PartnerKey?: string;

    @Column({ name: "token", type: "varchar", length: 50, nullable: true })
    Token?: string;

    @Column({ name: "mini_program_app_id", type: "varchar", length: 50, nullable: true })
    MiniProgramAppId?: string;

    @Column({ name: "mini_program_app_secret", type: "varchar", length: 50, nullable: true })
    MiniProgramSecret?: string;
}

@Entity("wx_user")
export class User {

    @Column({ primary: true, name: "id", type: "char", length: 36 })
    id: string;

    // @Column({ name: "name", type: "varchar", length: 50 })
    // name: string;

    @Column({ name: "create_date_time", type: "datetime" })
    createDateTime: Date;

    @Column({ name: "open_id", type: "varchar", length: 50 })
    openId: string;

    @Column({ name: "application_id", type: "varchar", length: 36 })
    applicationId: string;

}